<!DOCTYPE html>
<html lang="en">
	<head>
		<title>财政对账结果</title>
		<#include "../inc/header.ftl"/>
	</head>

	<body class="no-skin">

		<div class="main-container ace-save-state" id="main-container">

			<div class="main-content">
				<div class="main-content-inner">

					<div class="page-content">
						<div class="row">
							<div id="grid-main-data" class="col-xs-12">
								<table id="MainGrid" style="min-height: 500px"></table>
								<div id="toolbar">
									<div style="padding:8px">
                                        账户：<input id="bankid" name="bankid">
                                        收款日期：<input id="paybankdt" class="easyui-datebox" style="width:140px">&emsp;
                                        <a href="#" onclick="javascript:searchInfo()" class="easyui-linkbutton" iconCls="icon-search">查 询</a>

                                    </div>
								</div>
							</div>
                            <div id="SendBox-viewEdit" class="ui-dialog-content hide">
                                <table id="tableEdit"></table>
                            </div>
						</div><!-- /.row -->
					</div><!-- /.page-content -->

                </div>
			</div><!-- /.main-content -->
		</div><!-- /.main-container -->

		<!-- basic scripts -->
		<#include "../inc/basicjs.ftl"/>

		<!-- inline scripts related to this page -->
		<script type="text/javascript">
            //列表-------------------------------------------------
			jQuery(function($) {
                var curr_time = new Date();
                curr_time.setDate(curr_time.getDate()-1);
                var str = curr_time.getFullYear()+"-";
                str += curr_time.getMonth()+1+"-";
                str += curr_time.getDate();
                $('#paybankdt').datebox('setValue',str);

                $('#MainGrid').datagrid({
                    url:prefix + '/bill/bankcheckbill/findPreerrPage',
                    // checkbox: true,
                    pagination: true,
                    fitColumns:false,
                    striped: true,
                    singleSelect: true,
                    loadMsg: "正在加载数据，请稍后...",
                    queryParams: {bankid:0,paybankdt:$('#paybankdt').val()},
                    columns:[[
                        { title: '账号', field: 'accountcode', width:150,align:'left'},
                        { title: '开户行名称', field: 'bankname', width: 170 ,align:'left'},
                        { title: '日期', field: 'paybankdt', width: 100},
                        { title: '预审状态', field: 'state', width:100,formatter: function(value,row,index){
                                return row.state == 0 ? '成功' : '失败';
                            }},
                        { title: '财政对账状态', field: 'state1', width:100,formatter: function(value,row,index){
                                return row.state1 == 0 ? '成功' : '失败';
                            }},
                        { title: '对账结果', field: 'memo'}
                    ]],
                    toolbar: '#toolbar',
                    onLoadSuccess: function (data) {
                        if (data.total == 0) {
                            $('#grid-main-data').find('.datagrid-body').html('<div style="text-align: center;font-size: 14px;padding: 20px 0;">查询无数据</div>');
                        }
                    }
                });

                $(window).resize(function() {
                    $('#MainGrid').datagrid('resize');
                });
                $('#bankid').combogrid({
                    panelWidth:550,
                    idField:'bankid',
                    textField:'accountname',
                    data: _bankdata,
                    columns:[[
                        {field: 'ck', checkbox: true},
                        {field:'cantonname',title:'区划',width:80},
                        {field:'accountcode',title:'账号',width:160},
                        {field:'bankname',title:'开户行名称',width:260}
                    ]]
                });
			});

			function searchInfo() {
                var bankid = $('#bankid').val();
                var paybankdt = $('#paybankdt').val();
                if (bankid == '' && paybankdt == '') {
                    $.messager.alert('提示', '请选择账户或日期', 'info');
                    return;
                }
                $('#MainGrid').datagrid('load', {
                    bankid: bankid,
                    paybankdt: paybankdt
                });
			}

        </script>
	</body>
</html>
